import { Tooltip as AntdTooltip, type TooltipProps } from "antd"
import React, { Children, memo, type PropsWithChildren } from "react"

import { getStyleContainerRoot } from "~util"

const Tooltip = memo((params: PropsWithChildren<TooltipProps>) => {
  return (
    <AntdTooltip
      {...params}
      placement="bottom"
      getPopupContainer={() => getStyleContainerRoot()}
      getTooltipContainer={() => getStyleContainerRoot()}>
      {params.children}
    </AntdTooltip>
  )
})
export default Tooltip
